package com.ruoyi.bizsys.service.impl;

import java.util.List;
import java.util.Arrays;
                                                                                            import com.ruoyi.common.utils.DateUtils;
            import org.springframework.stereotype.Service;
    import com.ruoyi.bizsys.mapper.MarketLinkCreditLogMapper;
import com.ruoyi.bizsys.domain.MarketLinkCreditLog;
import com.ruoyi.bizsys.service.IMarketLinkCreditLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;


/**
 * 落地页记录Service业务层处理
 *
 * @author african-loan
 * @date 2021-10-28
 */
@Service
public class MarketLinkCreditLogServiceImpl extends ServiceImpl<MarketLinkCreditLogMapper,MarketLinkCreditLog> implements IMarketLinkCreditLogService {

    /**
     * 查询落地页记录
     *
     * @param id 落地页记录ID
     * @return 落地页记录
     */
    @Override
    public MarketLinkCreditLog selectMarketLinkCreditLogById(Long id) {
        return this.getById(id);
    }

    /**
     * 查询落地页记录列表
     *
     * @param marketLinkCreditLog 落地页记录
     * @return 落地页记录
     */
    @Override
    public List<MarketLinkCreditLog> selectMarketLinkCreditLogList(MarketLinkCreditLog marketLinkCreditLog) {
        return this.list(new QueryWrapper<>(marketLinkCreditLog).last("order by id desc"));
    }

    /**
     * 新增落地页记录
     *
     * @param marketLinkCreditLog 落地页记录
     * @return 结果
     */
            @Override
    public int insertMarketLinkCreditLog(MarketLinkCreditLog marketLinkCreditLog) {
                                                                                                                                                            marketLinkCreditLog.setCreateTime(DateUtils.getNowDate());
                            return baseMapper.insert(marketLinkCreditLog);
    }

    /**
     * 修改落地页记录
     *
     * @param marketLinkCreditLog 落地页记录
     * @return 结果
     */
            @Override
    public int updateMarketLinkCreditLog(MarketLinkCreditLog marketLinkCreditLog) {
                                                                                                                                                            return baseMapper.updateById(marketLinkCreditLog);
    }

    /**
     * 批量删除落地页记录
     *
     * @param ids 需要删除的落地页记录ID
     * @return 结果
     */
            @Override
    public int deleteMarketLinkCreditLogByIds(Long[] ids) {
        return baseMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除落地页记录信息
     *
     * @param id 落地页记录ID
     * @return 结果
     */
    @Override
    public int deleteMarketLinkCreditLogById(Long id) {
        return baseMapper.deleteById(id);
    }

}
